#include "DXUT.h" // this include has to be included in the beginning of each source file for compiling

#include "./../Headers/global.h"

// global variables
uint rand_seed = 1;

//--------------------------------------------------------------------------------------
// Global variables
//--------------------------------------------------------------------------------------
CDXUTDialogResourceManager          g_DialogResourceManager; // manager for shared resources of dialogs
CModelViewerCamera                  g_Camera;                // A model viewing camera
CD3DSettingsDlg                     g_D3DSettingsDlg;        // Device settings dialog
CDXUTDialog                         g_HUD;                   // manages the 3D   
CDXUTDialog                         g_SampleUI;              // dialog for sample specific controls

// Resources
CDXUTTextHelper*                    g_pTxtHelper = NULL;

ID3D11VertexShader*                 g_pVertexShader = NULL;
ID3D11HullShader*                   g_pHullShaderInteger = NULL;
ID3D11HullShader*                   g_pHullShaderFracEven = NULL;
ID3D11HullShader*                   g_pHullShaderFracOdd = NULL;
// Every surface will have its own DS
std::vector<ID3D11DomainShader*>    g_DomainShaderArray;
ID3D11PixelShader*                  g_pPixelShader = NULL;
ID3D11PixelShader*                  g_pSolidColorPS = NULL;

UINT                                g_iBindPerFrame = 0;

ID3D11RasterizerState*              g_pRasterizerStateSolid = NULL;
ID3D11RasterizerState*              g_pRasterizerStateWireframe = NULL;

// Control variables
float                               g_fSubdivs = 6;			// Startup subdivisions per side
bool                                g_bDrawWires = true;		// Draw the mesh with wireframe overlay

// List of defines for the shader to select which surface will be rendered
string g_ParametricSurfaces[] = {
	"SPHERE", "CONE", "TORUS", "CYLINDER", "TEAR", "CROSS_CAP",
	"STEINERS_ROMAN", "SEA_SHELL", "DINI", "HEART"
};
UINT								g_iNumSurfaces = ARRAYSIZE( g_ParametricSurfaces );
CDXUTComboBox*					g_pSurfaceSelectionCB = NULL;
UINT								g_iCurrentSurface = 0;

E_PARTITION_MODE							g_iPartitionMode = PARTITION_INTEGER;

Array<SIMPLE_CONTROL_POINT>			control_point_list;
ID3D11InputLayout*                  g_control_point_layout = NULL;
ID3D11Buffer*								control_point_list_gpu = NULL;

ConstantBuffer								*const_buf = NULL;

ShaderTexture								*tex_offset = NULL;
ID3D11SamplerState						*sampler_linear = NULL;
ShaderTexture								*tex_pos = NULL;
ID3D11SamplerState						*sampler_point = NULL;

float time_initial = 0.0;
float time_final = 10.0;

CDXUTComboBox						*ptrComboBox_time_anim = NULL;

int									time_anim_type = 0;

CDXUTComboBox						*ptrComboBox_time_interpol = NULL;

int									time_interpol_type = 0;
